<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: 'App',
  created() {
    // 在页面刷新时将vuex里的信息保存到sessionstorage里beforeunload事件在页面刷新时先触发
    window.addEventListener('beforeunload', () => {
      const fileRoute = ['/login', 'systemSelected']
      sessionStorage.setItem('newFlagBoolean', this.$route.path != '/' && fileRoute.indexOf(this.$route.path) == -1)
      if(this.$route.path != '/' && fileRoute.indexOf(this.$route.path) == -1) sessionStorage.setItem('path', this.$route.fullPath)
    })
  },
}
</script>
